# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=weasyprint
pkgver=56.0
pkgrel=0
pkgdesc="A visual rendering engine for HTML and CSS that can export to PDF"
url="https://weasyprint.org"
arch="noarch"
license="BSD-3-Clause"
depends="
	pango
	py3-brotli
	py3-cssselect2
	py3-cffi
	py3-fonttools
	py3-html5lib
	py3-pillow
	py3-pydyf
	py3-pyphen
	py3-tinycss2
	py3-zopfli
	"
makedepends="
	py3-build
	py3-flit
	py3-installer
	"
checkdepends="
	ghostscript
	py3-pytest
	py3-pytest-cov
	py3-pytest-flake8
	py3-pytest-isort
	py3-pytest-xdist
	ttf-dejavu
	"
replaces="py-weasyprint py3-weasyprint"  # for backward compatibility
provides="py-weasyprint=$pkgver-r$pkgrel py3-weasyprint=$pkgver-r$pkgrel"  # for backward compatibility
source="https://files.pythonhosted.org/packages/source/w/weasyprint/weasyprint-$pkgver.tar.gz"

build() {
	python3 -m build --no-isolation --wheel
}

check() {
	pytest --deselect tests/draw/test_text.py::test_otb_font
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/weasyprint-$pkgver-py3-none-any.whl
}

sha512sums="
d8efc83f77967a514d26806a9b73ef03e047431c6db9b367cd23a819b4a68714d216081afc74162b60084d0f3755498dc782d0335069bc9e70c42b611b737eec  weasyprint-56.0.tar.gz
"
